<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>

<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<title>订单查询-azhuo商城</title>
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta http-equiv="Cache-Control" content="no-siteapp" />

	<link rel="shortcut icon" href="${pageContext.request.contextPath }/image/logo/xyz.ico" type="image/x-icon" />
	<link rel="stylesheet" href="${pageContext.request.contextPath }/css/font.css" />
	<link rel="stylesheet" href="${pageContext.request.contextPath }/css/xadmin.css" />

	<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery.min.js"></script>
	<script src="${pageContext.request.contextPath }/lib/layui/layui.js" charset="utf-8"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath }/js/xadmin.js"></script>

</head>

<body>
	<div class="x-body">
		<xblock style="height: 35px; line-height: 35px;">
			<span>订单编号:${order.oid }</span>
			<span style="padding: 0 50px">总金额:${order.total }元</span>
			<span>下单时间：<fmt:formatDate value="${order.time }" pattern="yyyy年MM月dd日 HH:mm:ss" /></span>
			<span class="x-right" style="line-height:40px">共有商品：${fn:length(order.orderItemList) } 种</span>
		</xblock>

		<%-- 订单列表 --%>
		<table class="layui-table">
			<thead>
				<tr style="text-align: center;">
					<th>商品图片</th>
					<th>商品名称</th>
					<th>单价</th>
					<th>购买数量</th>
					<th>小计</th>
				</tr>
			</thead>
			<tbody>
				<c:forEach items="${order.orderItemList }" var="orderItem">
					<tr>
						<td>
							<img style="width: 70px;height: 70px;padding: 5px;"
								src="${pageContext.request.contextPath}/image/goods/${orderItem.goods.image}"
								alt="商品图片" />
						</td>
						<td>${orderItem.goods.gname }</td>
						<td>${orderItem.goods.price }元</td>
						<td>${orderItem.count }</td>
						<td>${orderItem.subtotal }元</td>
					</tr>
				</c:forEach>
			</tbody>
		</table>

	</div>
</body>

</html>